package com.example.controller;

import com.example.pojo.User;
import com.example.util.ResponseUtil;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：fbb
 * @version ：1.0
 * @since 2022-03-10 10:48
 */
@RestController
public class UserController {
    @PostMapping("/login")
    public Object login(@RequestBody User user){
        System.out.println(user);
        if(user!=null){
            return ResponseUtil.ok();
        }
            return ResponseUtil.fail("登录失败");
    }
    @PostMapping("/register")
    public Object register(@RequestBody User user){
        System.out.println(user);
        if(user!=null){
            return ResponseUtil.ok();
        }
        return ResponseUtil.fail("注册失败");
    }
}
